package com.jichaoyun.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jichaoyun.common.model.Result;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jichaoyun.model.entity.Valve;
import com.jichaoyun.model.entity.ValveChange;
import com.jichaoyun.model.vo.ValveComParametersVo;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
* @author ljc
* @description 针对表【valve】的数据库操作Service
* @createDate 2023-12-06 13:51:03
*/
public interface ValveService extends IService<Valve> {

    /**
     * 新增阀门
     * @param valve
     * @return
     */
    Result<Object> addValve(Valve valve);

    /**
     * 更改阀门信息
     * @param valve
     * @return
     */
    Result<Object>  updateValveInfo(Valve valve);

    /**
     * 获取阀门列表
     * @param pageNo
     * @param pageSize
     * @return
     */
    IPage<Valve> getValveList(Integer pageNo, Integer pageSize);


    /**
     * 分页查找阀门开启程度修改信息
     * @return
     */
    IPage<ValveChange> selectAllValveChangeData(Integer pageNo, Integer pageSize);


    /**
     * 获取所有阀门名称
     * @return
     */
    List<String> getAllValveName();

    /**
     * 根据阀门名称获取阀门编号、阀门状态信息
     * @param valveName
     * @return
     */
    Map<String,Object> getValveInfoByName(String valveName);

    /**
     * 更改阀门开启程度
     * @param valveId
     * @param status
     * @return
     */
    Result<Object> updateValveStatusById(Integer valveId,byte status) throws IOException;

    /**
     * 保存修改信息
     * @param valveChange
     * @return
     */
    Result<Object> addValveChangeData(ValveChange valveChange);



    /**
     * 导出阀门信息数据到excel
     * @param response
     * @throws IOException
     */
    void getValveExcel(HttpServletResponse response) throws IOException;

    /**
     * 修改阀门通讯参数信息
     * @param comParameters
     */
    Result<Object>  updateComParameters(ValveComParametersVo comParameters);
}
